home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / tjgrafx.com / TJGRAFIX.DOC < prev    next >
Encoding:
Text File  |  1989-01-03  |  8.4 KB  |  190 lines

  1.                             * TJGRAFIX *
  2.  
  3.  
  4.             Copyright (c), 1989 by
  5.                        Damn Fine Software Solutions
  6.                        PO Box 2073
  7.                        So. Londonderry, VT  05155-2073
  8.  
  9.             Version 1.0 written by Tab Julius  (CIS id: 72037,3662).
  10.  
  11.             FOR PERSONAL AND PRIVATE USE ONLY.  USERS WISHING TO USE IT
  12.             FOR COMMERCIAL APPLICATIONS MUST FULLY REGISTER ($30) THE
  13.             PRODUCT.  SEE THIS DOCUMENT AND FILE REGISTER.TJG FOR MORE
  14.             INFORMATION.  THIS SOFTWARE MAY ONLY BE DISTRIBUTED IN ITS
  15.             ENTIRETY.  FOR QUESTIONS AND INFORMATION, CONTACT THE ADDRESS
  16.             ABOVE OR SEND EMAIL TO CIS ID:  72037,3662.
  17.  
  18.  
  19.  
  20.             The following is the interface for TJGrafix:
  21.  
  22.  
  23.  
  24.  
  25. Unit TJGrafix;
  26.  
  27. Interface
  28. Uses Dos,Graph;
  29.  
  30. var
  31.    Use_BIOS_with_TJGrafix      :boolean;
  32.  
  33.  
  34.  
  35.  
  36.  
  37. Procedure Enter_256_Color_Mode;
  38. Procedure Set_Cursor_Location(row,col :byte);
  39. Procedure Find_Cursor(var row,col :byte);
  40. Function Character_Under_Cursor :byte;
  41. Procedure Put_At_Cursor_in_256(character,fore,back,how_many :byte);
  42. Procedure Put_String_in_256(row,col,fore,back :word; wording :string);
  43. Procedure Set_Pixel_BIOS(horiz,vert,color :word);
  44. Procedure Get_Pixel_BIOS(horiz,vert:word; var color :word);
  45. Procedure Set_Pixel(horiz,vert :word; color :word);
  46. Procedure Get_Pixel(horiz,vert :word; var color :word);
  47. Procedure Horiz_Bar(horiz,vert,length,color :word);
  48. Procedure Vert_Bar(horiz,vert,length,color :word);
  49. Procedure Box(l_col,l_row,r_col,r_row,color  :word);
  50. Procedure Solid_Box(l_col,l_row,r_col,r_row,color  :word);
  51. Procedure Ribbon_Box(l_col,l_row,r_col,r_row,initial_color,spacing :word);
  52. Procedure Vert_Ribbon_Box(l_col,l_row,r_col,r_row,initial_color,spacing :word);
  53. Procedure Grow_Ribbon_Box_Light(horiz,vert,radius,initial_color :word);
  54. Procedure Grow_Ribbon_Box_Dark(horiz,vert,radius,initial_color :word);
  55. Procedure Shrink_Ribbon_Box_Light(horiz,vert,radius,initial_color :word);
  56. Procedure Shrink_Ribbon_Box_Dark(horiz,vert,radius,initial_color :word);
  57. Procedure Shrink_Solid_Box(horiz,vert,radius,color :word);
  58. Procedure Dissolve_Box_Into_Color(l_horiz,l_vert,r_horiz,r_vert,color :word);
  59.  
  60.  
  61. ================================
  62. Conventions:
  63.             In get/set pixel commands:  horiz & vert are the location of the
  64.                pixel, color is the color to set (or value returned).
  65.  
  66.             In horiz/vert bars:  horiz & vert are the starting point, length
  67.                is the length of the bar.
  68.  
  69.             In box stuff:  l_col,l_row,r_col,r_row refer to the upper left
  70.                location and the bottom right location.  It probably should
  71.                have been called l_horiz,l_vert, but, hey.
  72.  
  73.             In fancier box stuff:  initial_color is the color that the draw
  74.                routines begin with, increasing it's value with Spacing, or
  75.                changing it darker or lighter depending on the routine.  With
  76.                Shrink and Grow boxes, specify the center of the box, and the
  77.                radius to which it will grow.
  78.  
  79.             In text stuff, fore and back are foreground and background colors
  80.                of the character value (it's ord) or the string if placing a
  81.                string.  You will notice that row comes before col when
  82.                specifying text locations.  This is actually Gods will when
  83.                declaring text locations, though much of America seems to be
  84.                preferring it the other way 'round.
  85.  
  86.  
  87.             USING THE TPU:  It is not necessary to invoke Borland's Initgraph,
  88.             though we usually do, because it provides a convenient way of
  89.             checking the graphics driver.  For that reason, you might prefer
  90.             to enter Initgraph, if everything is OK and the graphics equipment
  91.             is a VGA,MCGA, or EGA that does the big 256, then use the
  92.             Enter_256_Color_Mode.  Note that other Borland Graph unit routines
  93.             will not work at this point, however you can use CloseGraph to get
  94.             you back out.  Although there is no "clear screen" command, you
  95.             will find that re-using Enter_256_Color_Mode will do the trick.
  96.  
  97.  
  98.  
  99. How much?
  100.  
  101.     o  This TPU is available as shareware for the reasonable price of
  102.        a dollar.
  103.  
  104.     o  However, DFSS offers full registration which will provide you
  105.        with the following, for a $30 fee:
  106.  
  107.                    o  Source code to the .TPU (which you would need if
  108.                       America has to recompile for Turbo Pascal version 6).
  109.  
  110.                    o  Extended documention, customer support.
  111.  
  112.                    o  The 5x8 font, which is used in the demo, but not
  113.                       included in this .TPU.
  114.  
  115.                    o  Any future releases for only the cost of the media
  116.                       plus postage and handling.  Future releases will
  117.                       not be available via CompuServe.
  118.  
  119.                    o  Permission to use this software in commercial
  120.                       applications.
  121.  
  122.  
  123. What does it do?
  124.  
  125.     o  It provides routines to let you take advantage of the 256-color
  126.        capabilities of the IBM MCGA,EGA, and VGA within your programs
  127.        with minimal difficulty.
  128.  
  129.        Specifically, this version sets pixels in any of the 256 colors
  130.        (keep in mind this is 320x200 mode), determines pixel value, moves
  131.        the cursor, finds the cursor, finds the character under the cursor,
  132.        places a string at the cursor location, puts a 5x8 string down (if
  133.        you have fully registered the product), draws horizontal and vertical
  134.        lines, draws boxes, draws filled-in (solid) boxes, draws ribbon boxes
  135.        (a better name would have been rainbox boxes), grows or shrinks boxes
  136.        and finally dissolves boxes to your choice of color.
  137.  
  138.        Also included is 256.exe which is a helpful little program to use
  139.        to determine the value (17-247) of the colors you wish to use.
  140.  
  141.        A demo program is included which first displays the DFSS logo (made
  142.        with TJGrafix) and then some demonstrations of rainbow boxes, growing
  143.        and shrinking boxes, and dissolving boxes.
  144.  
  145.  
  146.     o  Normally TJGrafix writes directly to the screen, but if you want to
  147.        use bios calls, USE_BIOS_WITH_TJGRAFIX is a boolean variable that
  148.        controls the technique used.  Normally false, set it as you wish.
  149.        As usual, the tradeoff between direct-writes and a "well behaved"
  150.        program is speed.  Tragically so when you are working at the pixel
  151.        level.
  152.  
  153.     o  Note on the demo:  The demo program itself does not check to see if
  154.        you have an MCGA,EGA, or VGA.  It just assumes you do.  No promises
  155.        are made as to what will happen if you don't.
  156.  
  157.  
  158.  
  159.        WHEN RUNNING THE DEMO:
  160.  
  161.         Format:   TJDEMO [/B]
  162.  
  163.         o  Make sure you have the appropriate .BGI driver in your default
  164.            directory (i.e.:  EGAVGA.BGI).
  165.  
  166.         o  Use /B or /b as a command switch to force BIOS calls if preferred.
  167.            This will make it considerably slower, though.
  168.  
  169.         -  The DFSS logo will run first.
  170.         -  One staggered-color box will appear.  Press any key.
  171.         -  A more-staggered-color box will appear.  Press any key.
  172.         -  A range of colors will fill the screen.  Press any key.
  173.         -  Ribbon boxes will appear and move internally.  If you have an
  174.            80286 machine this appears to be fairly fluid movement.  If you
  175.            are running a model 30 or using BIOS calls it's not quite the
  176.            same effect, though interesting.  Press any key when they stop.
  177.         -  Shrink and grow light/dark demos appear.  Press any key after each.
  178.         -  A solid orangish-colored box appears.  Press any key.
  179.         -  The box will dissolve into various solid-colored boxes.  After the
  180.            last one, the screen will clear with a final message.
  181.  
  182.  
  183.         As mentioned earlier, 256.EXE is included.  This will draw the range
  184.         of colors from 17 to 247.  The colors outside this range are either
  185.         your normal 16 colors (under 17) or black (at least on our equipment).
  186.  
  187.         To use, run program (sorry, only direct video writing used there).
  188.         Press ESC at any time to leave.  Press space bar to advance a color
  189.         and see the associated value.
  190.                                                                        *taj